#define _CRT_SECURE_NO_WARNINGS 1

#include"DList.h"

void Test1()
{
	LTNode* plist = LTInit();
	LTPushBack(plist, 1);
	LTPushBack(plist, 2);
	LTPushBack(plist, 3);
	LTPrint(plist);

	LTPopBack(plist);
	LTPrint(plist);

	LTPopBack(plist);
	LTPrint(plist);

	LTPopBack(plist);
	LTPrint(plist);
}

void Test2()
{
	LTNode* plist = LTInit();
	LTPushBack(plist, 1);
	LTPushBack(plist, 2);
	LTPushBack(plist, 3);
	LTPrint(plist);

	LTPushFront(plist, 10);
	LTPrint(plist);

	LTPopFront(plist);
	LTPrint(plist);
	LTDestory(plist);
}

void Test3()
{
	LTNode* plist = LTInit();
	LTPushBack(plist, 1);
	LTPushBack(plist, 2);
	LTPushBack(plist, 3);
	LTPrint(plist);

	LTNode* pos = LTFind(plist, 3);
	if (pos)
	{
		pos->val *= 10;
	}
	LTPrint(plist);

	LTInsert(pos, 10);
	LTPrint(plist);

	LTErase(pos);
	LTPrint(plist);

}


int main()
{
	Test2();
	return 0;
}








